import 'dart:math';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class MScaffold {
  // final BuildContext context;
  //
  // MScaffold(this.context);

  Scaffold scaffold(
      {required Widget child, Color? backgroundColor, bool topPadding = true}) {
    return Scaffold(

      backgroundColor: backgroundColor ?? Colors.black,
      body: Stack(
        children: [
          ...bac(),
          if (topPadding)
            SafeArea(
                child: Padding(
                    padding: const EdgeInsets.only(top: 10), child: child))
          else
            child
        ],
      ),
    );
  }

  void actionColor(
      {Color? color, required bool isLight, required String page}) {
    SystemChrome.setSystemUIOverlayStyle(
      SystemUiOverlayStyle(
          systemNavigationBarColor: color ?? Colors.transparent,
          systemNavigationBarDividerColor: color ?? Colors.transparent,
          statusBarColor: color ?? Colors.transparent,
          statusBarBrightness: isLight ? Brightness.light : Brightness.dark,
          statusBarIconBrightness: isLight ? Brightness.light : Brightness.dark,
          systemNavigationBarIconBrightness:
          isLight ? Brightness.light : Brightness.dark),
    );
  }


  List<Widget> bac() {
    return [
      Container(
        padding: const EdgeInsets.only(),
        margin: const EdgeInsets.only(),
        alignment: Alignment.center,
        decoration: BoxDecoration(
            gradient: LinearGradient(
                colors: [
                  const Color(0xff40118a).withOpacity(0.60),
                  const Color(0xff000000),
                ],
                begin: Alignment.topCenter,
                end: Alignment.bottomCenter)),
      ),
      Positioned(
          left: -90,
          top: -100,
          child: Container(
            padding: const EdgeInsets.only(),
            margin: const EdgeInsets.only(),
            height: 100,
            width: 100,
            alignment: Alignment.center,
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(100),
              boxShadow: [
                BoxShadow(
                    color: const Color(0xffff1744).withOpacity(0.12),
                    spreadRadius: 99,
                    blurRadius: 99)
              ],
            ),
          )),
      Positioned(
          left: 227,
          top: -76,
          child: Container(
            padding: const EdgeInsets.only(),
            margin: const EdgeInsets.only(),
            height: 30,
            width: 30,
            alignment: Alignment.center,
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(100),
              boxShadow: [
                BoxShadow(
                    color: const Color(0xffff1744).withOpacity(0.12),
                    spreadRadius: 99,
                    blurRadius: 99)
              ],
            ),
          )),
      Positioned(
          left: 450,
          top: 140,
          child: Container(
            padding: const EdgeInsets.only(),
            margin: const EdgeInsets.only(),
            height: 100,
            width: 100,
            alignment: Alignment.center,
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(100),
              boxShadow: [
                BoxShadow(
                    color: const Color(0xffff1744).withOpacity(0.05),
                    spreadRadius: 99,
                    blurRadius: 99)
              ],
            ),
          )),
    ];
  }
}
